Timeseries clustering

Time series clustering is to partition time series data into groups based on similarity or distance, so that time series in the same cluster are similar.

Methodology followed:

Paper: https://arxiv.org/pdf/1412.6581.pdf

Contents

  1. Functions
  2. Import
  3. Load data and preprocess
  4. Initialize VRAE object
  5. Fit the model onto dataset
  6. Transform the input timeseries to encoded latent vectors
  7. Save the model to be fetched later

Import required modules

Download dir

Hyper parameters

Load data and preprocess

Initialize VRAE object

VRAE inherits from sklearn.base.BaseEstimator and overrides fit, transform and fit_transform functions, similar to sklearn modules

Fit the model onto dataset

Plot loss and MSE

Transform the input timeseries to encoded latent vectors

Save / load the model

Reconstruction

Convert PC back to channel traces

Reconstruction of test dataset

Visualize latent space using PCA and tSNE